import request from '@/utils/request'
const api_name = '/manage/admin/courses'

export function getPageList(page, limit, searchParams) {
  return request({
    url: `${api_name}/${page}/${limit}`,
    method: 'get',
    params: searchParams
  })
}

export function updateCourseStatus(id,status) {
  return request({
    url: `${api_name}/${id}/${status}`,
    method: 'put',
  })
}

export function searchCourse(name) {
  return request({
    url: `${api_name}/${name}`,
    method: 'get'
  })
}

export function getCourseNameById(id) {
  return request({
    url: `${api_name}/name/${id}`,
    method: 'get'
  })
}
